]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
windowPreview: Replace the click action with a click and long press gesture
authorJonas Dreßler <verdre@v0yd.nl>
Tue, 8 Jul 2025 14:58:25 +0000 (16:58 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 28 Aug 2025 17:14:06 +0000 (19:14 +0200)
In the porting, temporarily stop integrating the WindowPreview gestures with
DnD, this used to be done through addClickAction() but DnD will change to
using gestures in later commits, making its porting moot. This integration
will be restored later on.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2853>

js/ui/windowPreview.js

index 3bc04187e4bd102d698650be497f142523b93122..6e1593de8b7b0a94bf076116dfaf62d22a675d3f 100644 (file)
@@ -115,15 +115,13 @@ export const WindowPreview = GObject.registerClass({
             this);
         this.inDrag = false;
 
-        let clickAction = new Clutter.ClickAction();
-        clickAction.connect('clicked', () => this._activate());
-        clickAction.connect('long-press', (action, actor, state) => {
-            if (state === Clutter.LongPressState.ACTIVATE)
-                this.showOverlay(true);
-            return true;
-        });
+        const clickGesture = new Clutter.ClickGesture();
+        clickGesture.connect('recognize', () => this._activate());
+        this.add_action(clickGesture);
 
-        this._draggable.addClickAction(clickAction);
+        const longPressGesture = new Clutter.LongPressGesture();
+        longPressGesture.connect('recognize', () => this.showOverlay(true));
+        this.add_action(longPressGesture);
 
         this._overlayEnabled = true;
         this._overlayShown = false;